Switch the default async Postgres driver from asyncpg to psycopg3 (provider)#69089
Open
Dev-iL wants to merge 1 commit into
Open
Switch the default async Postgres driver from asyncpg to psycopg3 (provider)#69089Dev-iL wants to merge 1 commit into
Dev-iL wants to merge 1 commit into
Conversation
1 task
608e0e0 to
35697d5
Compare
…psycopg3 The async metadata-database driver shipped by the postgres provider now defaults to psycopg3, which is safe behind transaction-mode PgBouncer with no extra configuration. asyncpg moves to the opt-in `asyncpg` extra and remains fully supported via an explicit sql_alchemy_conn_async URL. This pairs with the matching default change in Airflow 3.4.0.
35697d5 to
ec31a5a
Compare
uranusjr
reviewed
Jul 2, 2026
Comment on lines
+30
to
+42
| .. warning:: | ||
| ``asyncpg`` is no longer installed by default — it moved to the ``asyncpg`` optional extra, and | ||
| ``psycopg`` (psycopg3) is now installed by default as the async metadata-database driver. The | ||
| default derived async connection URL changed from ``postgresql+asyncpg://`` to | ||
| ``postgresql+psycopg_async://``, which is safe behind transaction-mode PgBouncer with no extra | ||
| configuration. This aligns with the new default async Postgres driver in Airflow 3.4.0. To keep | ||
| using asyncpg, install ``apache-airflow-providers-postgres[asyncpg]`` and set | ||
| ``[database] sql_alchemy_conn_async = postgresql+asyncpg://...`` explicitly. | ||
|
|
||
| On Airflow versions before 3.4.0 the derived async URL always uses asyncpg (there is no psycopg3 fallback in core), | ||
| so on those versions this provider release requires either the ``asyncpg`` extra or an explicitly configured | ||
| ``[database] sql_alchemy_conn_async`` — otherwise the async metadata-database engine fails at startup with | ||
| ``ModuleNotFoundError: No module named 'asyncpg'``. |
Member
There was a problem hiding this comment.
This should also mention the psycopg extra has been removed so you should remove [psycopg].
Also let’s add a 7.0.0 version header. (I think this should be a major version since this is technically a breaking change?)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Split from the below, see details there: